<template>
  <view class="detail-box">
    <view class="detail-title row-warpper">{{ title }}</view>
    <scroll-view class="detail" :scroll-y="true">
      <uni-section type="line" title="项目编号">
        {{ projectDetail.number }}
      </uni-section>
      <uni-section type="line" title="标题">
        {{ projectDetail.title }}
      </uni-section>
      <uni-section type="line" title="项目名称">
        {{ projectDetail.xmgg_title }}
      </uni-section>
      <uni-section type="line" title="项目联系人">
        {{ projectDetail.xmlxr }}
      </uni-section>
      <uni-section type="line" title="项目联系人电话">
        {{ projectDetail.xmlxrdh }}
      </uni-section>
      <uni-section type="line" title="是否为政务服务事项中介服务项目采购">
        {{ shifouFilters(projectDetail.ifzjfwxm) }}
      </uni-section>
      <uni-section type="line" title="是否为省重点项目">
        {{ zdxmFilters(projectDetail.ifzdxm) }}
      </uni-section>
      <uni-section type="line" title="项目基本情况">
        <view v-html="projectDetail.content"></view>
      </uni-section>
      <uni-section type="line" title="项目完成时限">
        {{ projectDetail.handlelimit }}
      </uni-section>
      <uni-section type="line" title="拟定服务费/费率">
        {{ projectDetail.servicefee }}
      </uni-section>
      <uni-section type="line" title="中介机构条件">
        <view v-html="projectDetail.jigoutj"></view>
      </uni-section>
      <uni-section type="line" title="报价次数">
        {{ projectDetail.count }}
      </uni-section>
      <uni-section type="line" title="发布时间">
        {{ projectDetail.fbdate }}
      </uni-section>
      <uni-section type="line" title="报名开始时间">
        {{ projectDetail.bmstarttime }}
      </uni-section>
      <uni-section type="line" title="报名截止时间">
        {{ projectDetail.bmendtime }}
      </uni-section>
      <uni-section v-if="projectDetail.selectmode===6" type="line" title="选取开始时间">
        {{ projectDetail.yaohaodate }}
      </uni-section>
      <uni-section v-if="projectDetail.selectmode===6" type="line" title="选取截止时间">
        {{ projectDetail.yaohaostartdate }}
      </uni-section>
      <uni-section v-if="projectDetail.selectmode===9" type="line" title="选取开始时间">
        {{ projectDetail.yaohaodate }}
      </uni-section>
      <uni-section v-if="projectDetail.selectmode===9" type="line" title="选取截止时间">
        {{ projectDetail.yaohaostartdate }}
      </uni-section>
    </scroll-view>
  </view>
</template>

<script>
import sysRequest from "../../../../common/request/sysRequest";

export default {
  name: "ViewDetail",
  mixins: [sysRequest],
  props: ["title", "projectDetail"],
  created() {
    const shifouPd = {
      code: "shifou"
    }
    this.getDictItems(shifouPd, data => {
      this.shifouList = data
    })
    const zdxmPd = {
      code: "zdxm"
    }
    this.getDictItems(zdxmPd, data => {
      this.zdxmList = data
    })
  },
  data() {
    return {
      shifouList: [],
      zdxmList: []
    }
  },
  methods: {
    /**
     * 是否
     * @param {Object} number
     */
    shifouFilters(number) {
      let result = ""
      this.shifouList.forEach(item => {
        if (number === item.value) {
          result = item.label
        }
      })
      return result
    },
    /**
     * 重点项目
     * @param {Object} number
     */
    zdxmFilters(number) {
      let result = ""
      this.zdxmList.forEach(item => {
        if (number === item.value) {
          result = item.label
        }
      })
      return result
    }
  }
}
</script>

<style lang="less" scoped>
.detail-box {
  padding: 12px;
  min-height: 80vh;
  min-width: 100vw;
  background-color: #ffffff;
  border-radius: 14px;

  .detail-title {
    align-self: stretch;
    justify-content: center;
    padding: 5px;
    color: #909399;
    border-bottom: 1px solid #909399;
    margin-bottom: 2px;
  }

  .detail {
    max-height: 70vh;
  }
}
</style>
